package com.Lyy.dao;

import com.Lyy.entity.Dept;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Mapper
public interface DeptMapper {
    @Select("select dept_id deptId,dept_name deptName from worker.dept")
    public List<Dept> SelectDeptAll();

    @Select("select dept_id deptId,dept_name deptName from worker.dept where dept_id = #{id}")
    public Dept SelectDeptOne(int id);

    @Insert("insert into worker.dept (dept_name) values (#{deptName})")
    public int AddDept(Dept dept);

    @Delete("delete from worker.dept where dept_id = #{id}")
    public int DelDeptByID(int id);

    @Update("update worker.dept set dept_name = #{deptName} where dept_id = #{deptId}")
    public int UpdateDeptByID(Dept dept);
}
